<template>
 <!-- 发展 - 日看板 -->
  <div>
    <van-loading v-if="isLoading" type="spinner" color="#1989fa" />
    <div v-else class="board-fz-info">
      <van-swipe :show-indicators="false" :autoplay="3000" indicator-color="white">
        <van-swipe-item>
          <div class="board-fz-item">
            <div>移网</div>
            <div class="sub-title">当月累计/当月目标</div>
            <div class="value" @click="openPeopleDetail('gsm', info.GSM_M_VALUE, info.MB_GSM_VALUE, info.GSM_HB)">{{ info.GSM_M_VALUE || 0 }}/{{ info.MB_GSM_VALUE || 0}}<span class="unit">户</span></div>
            <div class="percent-title">
              月累计环比
              <span v-if="info.GSM_HB >= 0" class="percent up">
                {{ info.GSM_HB }}%
                <img src="~@/assets/imgs/publicline/index/arrow_up.png" />
              </span>
              <span v-else class="percent down">
                {{ info.GSM_HB }}%
                <img src="~@/assets/imgs/publicline/index/arrow_down.png" />
              </span>
            </div>
          </div>
          <div class="board-fz-item">
            <div>宽带</div>
            <div class="sub-title">当月累计/当月目标</div>
            <div class="value" @click="openPeopleDetail('kd', info.KD_M_VALUE, info.MB_KD_VALUE, info.KD_HB)">{{ info.KD_M_VALUE || 0 }}/{{ info.MB_KD_VALUE || 0}}<span class="unit">户</span></div>
            <div class="percent-title">
              月累计环比
              <span v-if="info.KD_HB >= 0" class="percent up">
                {{ info.KD_HB }}%
                <img src="~@/assets/imgs/publicline/index/arrow_up.png" />
              </span>
              <span v-else class="percent down">
                {{ info.KD_HB }}%
                <img src="~@/assets/imgs/publicline/index/arrow_down.png" />
              </span>
            </div>
          </div>
        </van-swipe-item>
        <van-swipe-item>
          <div class="board-fz-item">
            <div>融合</div>
            <div class="sub-title">当月累计/当月目标</div>
            <div class="value" @click="openPeopleDetail('rh', info.RH_M_VALUE, info.MB_RH_VALUE, info.RH_VALUE)">{{ info.RH_M_VALUE || 0 }}/{{ info.MB_RH_VALUE || 0}}<span class="unit">户</span></div>
            <div class="percent-title">
              月累计环比
              <span v-if="info.RH_VALUE >= 0" class="percent up">
                {{ info.RH_VALUE }}%
                <img src="~@/assets/imgs/publicline/index/arrow_up.png" />
              </span>
              <span v-else class="percent down">
                {{ info.RH_VALUE }}%
                <img src="~@/assets/imgs/publicline/index/arrow_down.png" />
              </span>
            </div>
          </div>
          <!-- <div class="board-fz-item">
            <div>云企通</div>
            <div class="sub-title">当月累计/当月目标</div>
            <div class="value" @click="openPeopleDetail('yqt', info.YQT_D_M, info.MB_YQT_VALUE, info.YQT_HB)">{{ info.YQT_D_M || 0 }}/{{ info.MB_YQT_VALUE || 0}}<span class="unit">户</span></div>
            <div class="percent-title">
              月累计环比
              <span v-if="info.YQT_HB >= 0" class="percent up">
                {{ info.YQT_HB }}%
                <img src="~@/assets/imgs/publicline/index/arrow_up.png" />
              </span>
              <span v-else class="percent down">
                {{ info.YQT_HB }}%
                <img src="~@/assets/imgs/publicline/index/arrow_down.png" />
              </span>
            </div>
          </div> -->
          <div class="board-fz-item">
            <div>固话</div>
            <div class="sub-title">当月累计/当月目标</div>
            <div class="value" @click="openPeopleDetail('gh', info.GH_M_VALUE, info.MB_GH_VALUE, info.GH_HB)">{{ info.GH_M_VALUE || 0 }}/{{ info.MB_GH_VALUE || 0}}<span class="unit">户</span></div>
            <div class="percent-title">
              月累计环比
              <span v-if="info.GH_HB >= 0" class="percent up">
                {{ info.GH_HB }}%
                <img src="~@/assets/imgs/publicline/index/arrow_up.png" />
              </span>
              <span v-else class="percent down">
                {{ info.GH_HB }}%
                <img src="~@/assets/imgs/publicline/index/arrow_down.png" />
              </span>
            </div>
          </div>
        </van-swipe-item>
        <van-swipe-item>
          <div class="board-fz-item">
            <div>5G</div>
            <div class="sub-title">当月累计/当月目标</div>
            <div class="value" @click="openPeopleDetail('gsm5g', info.GSM_5G_M_VALUE, info.MB_GSM_5G_VALUE, info.GSM_5G_HB)">{{ info.GSM_5G_M_VALUE || 0 }}/{{ info.MB_GSM_5G_VALUE || 0}}<span class="unit">户</span></div>
            <div class="percent-title">
              月累计环比
              <span v-if="info.GSM_5G_HB >= 0" class="percent up">
                {{ info.GSM_5G_HB }}%
                <img src="~@/assets/imgs/publicline/index/arrow_up.png" />
              </span>
              <span v-else class="percent down">
                {{ info.GSM_5G_HB }}%
                <img src="~@/assets/imgs/publicline/index/arrow_down.png" />
              </span>
            </div>
          </div>
          <div class="board-fz-item">
            <div>千兆</div>
            <div class="sub-title">当月累计/当月目标</div>
            <div class="value" @click="openPeopleDetail('qz', info.QZ_M_VALUE, info.MB_QZ_VALUE, info.QZ_HB)">{{ info.QZ_M_VALUE || 0 }}/{{ info.MB_QZ_VALUE || 0}}<span class="unit">户</span></div>
            <div class="percent-title">
              月累计环比
              <span v-if="info.QZ_HB >= 0" class="percent up">
                {{ info.QZ_HB }}%
                <img src="~@/assets/imgs/publicline/index/arrow_up.png" />
              </span>
              <span v-else class="percent down">
                {{ info.QZ_HB }}%
                <img src="~@/assets/imgs/publicline/index/arrow_down.png" />
              </span>
            </div>
          </div>
        </van-swipe-item>
      </van-swipe>
    </div>
  </div>
</template>

<script>
import { morningDayAdvance } from '@/api/publicline/board.js'

export default {
  components: { },
  data() {
    return {
      isLoading: true,
      info: {},
      queryParams: {}
    }
  },
  methods: {
     // 晨会看板-日看板-发展
    async getMorningDayAdvance(params) {
      this.isLoading = true
      this.queryParams = params
      const res = await morningDayAdvance(params)
      const { result, success } = res
      if (success) {
        this.info = result[0] || {}
        this.isLoading = false
      }
    },
    openPeopleDetail(type, value = 0, mvalue = 0, hb = 0) {
      this.$open.call(this, '/publicline/board/personal',
        {
          ...this.queryParams,
          type: type,
          flag: 'morning',
          value, mvalue, hb
        }
      )
    }
  }
}
</script>

